/*  1:   */ package com.huawei.m2m.cig.decoder.hzhiqiang.wzhiqiang.generate.factory;
/*  2:   */ 
/*  3:   */ import com.huawei.m2m.cig.decoder.hzhiqiang.wzhiqiang.generate.cloud.downlink;
/*  4:   */ import com.huawei.m2m.cig.decoder.protocol.NBMessage;
/*  5:   */ import java.util.Map;
/*  6:   */ import java.util.concurrent.ConcurrentHashMap;
/*  7:   */ import org.slf4j.Logger;
/*  8:   */ import org.slf4j.LoggerFactory;
/*  9:   */ 
/* 10:   */ public class DefaultCloudMessageFactory
/* 11:   */ {
/* 12:16 */   private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCloudMessageFactory.class);
/* 13:18 */   private static final DefaultCloudMessageFactory INSTANCE = new DefaultCloudMessageFactory();
/* 14:20 */   private Map<String, Class<? extends NBMessage>> messageFactory = new ConcurrentHashMap();
/* 15:   */   
/* 16:   */   public static DefaultCloudMessageFactory getInstance()
/* 17:   */   {
/* 18:24 */     return INSTANCE;
/* 19:   */   }
/* 20:   */   
/* 21:   */   public NBMessage createMessage(String paramString)
/* 22:   */   {
/* 23:29 */     return createInstance((Class)this.messageFactory.get(paramString));
/* 24:   */   }
/* 25:   */   
/* 26:   */   public String getCloudMessageRspName()
/* 27:   */   {
/* 28:33 */     return null;
/* 29:   */   }
/* 30:   */   
/* 31:   */   private NBMessage createInstance(Class<? extends NBMessage> paramClass)
/* 32:   */   {
/* 33:   */     try
/* 34:   */     {
/* 35:40 */       if (paramClass != null) {
/* 36:42 */         return (NBMessage)paramClass.newInstance();
/* 37:   */       }
/* 38:   */     }
/* 39:   */     catch (Exception localException)
/* 40:   */     {
/* 41:46 */       LOGGER.error("Unexpected exception when createInstance.Exception:", localException);
/* 42:   */     }
/* 43:49 */     return null;
/* 44:   */   }
/* 45:   */   
/* 46:   */   private DefaultCloudMessageFactory()
/* 47:   */   {
/* 48:54 */     this.messageFactory.put("downlink", downlink.class);
/* 49:   */   }
/* 50:   */ }


/* Location:           C:\Users\Zou Songhua\Downloads\zhiqiang_CIGPlug-in_sign\zhiqiang_CIGPlug-in.zip_sign\zhiqiang_CIGPlug-in\preload\zhiqiang-zhiqiang-zhiqiang-1.0.0.jar
 * Qualified Name:     com.huawei.m2m.cig.decoder.hzhiqiang.wzhiqiang.generate.factory.DefaultCloudMessageFactory
 * JD-Core Version:    0.7.0.1
 */